﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    ReportViewer
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div style="text-align:center"> <h3>Report Topping</h3></div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="FeaturedContent" runat="server">

</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="TableContent" runat="server">
<style type="text/css">
.block {
	border:1px solid #afafaf;
	border-top-width:3px;
	padding:0 10px;
	background-color:White;
}
.inactivecat, .activecat   {
  padding:10px 5px 8px;
  border-bottom:1px dashed #ccc;
  text-align:left;

}
.inactivecat a
{
  color:#5793DB !important; 
  font-weight:bolder;
}
.activecat a
{
  color:#ff0000 !important; 
  font-weight:bolder;
}
a {text-decoration:none; outline:none; }
a:hover {color:#ff0000;  text-decoration: none;}
.btn
{
margin-top:10px;
width:120px;
height:25px;
margin-right:5px;
}
.hide
{
    display:none;
}
</style>
    <div class="block" style="width:180px;	float:left;">
        <table cellspacing="0" cellpadding="0">
            <tbody>
               
                <tr>
                    <td class="activecat">
                        <a href="#" id="a1">&nbsp;1.&nbsp;&nbsp;Head &amp; Tail&nbsp;</a>
                    </td>
                </tr>
                <tr>
                    <td class="inactivecat">
                        <a href="#" id="a2">&nbsp;2.&nbsp;&nbsp;TopCord Bom&nbsp;</a>
                    </td>
                </tr>
           
                <tr>
                    <td class="inactivecat">
                        <a href="#" id="a3">&nbsp;3.&nbsp;&nbsp;Waste&nbsp;</a>
                    </td>
                </tr>
                <tr>
                    <td class="inactivecat">
                        <a href="#" id="a4">&nbsp;4.&nbsp;&nbsp;Compund Used&nbsp;</a>
                    </td>
                </tr>
                <tr>
                    <td class="inactivecat">
                        <a href="#" id="a5">&nbsp;5.&nbsp;&nbsp;Topcord CMPCH&nbsp;</a>
                    </td>
                </tr>
                <tr>
                    <td class="inactivecat">
                        <a href="#" id="a6">&nbsp;6.&nbsp;&nbsp;Allocate&nbsp;</a>
                    </td>
                </tr>
                <tr>
                    <td class="inactivecat">
                        <a href="#" id="a7">&nbsp;7.&nbsp;&nbsp;PDF Head &amp;Tail &nbsp;</a>
                    </td>
                </tr>

            </tbody>
        </table>
        <br>
    </div>
      <div class="block" style="width:800px; height:300px; float:left;">
      <br />
        <table>
        <tr ><td colspan="2" style="font-size:large; line-height:40px;" id="nmRpt" ></td></tr>
        <tr id="df" ><td class="head cell" style="width:150px; height:30px;">Date From</td><td class="cell"><input type="text" id="dFrom"/></td></tr>
        <tr id="dt"><td class ="head cell" style="width:150px; height:30px;">Date To</td><td class="cell"><input type="text"  id="dTo"/><button  id="search"></button></td></tr>
        
        </table>
      </div>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="ScriptsSection" runat="server">
    <% if (false)
      { %>
   <script src="../../Scripts/jquery-1.7.2.js" type="text/javascript"></script>
   <% }; %>

<script type="text/javascript">
    $(function () {
        $('#dFrom').dateEntry({ useMouseWheel: false, dateFormat: 'dmy/' })
        $('#dTo').dateEntry({ useMouseWheel: false, dateFormat: 'dmy/' })
        $("#nmRpt").text($(".activecat").text());
        $("#search,#search2").button({
            icons: { primary: 'ui-icon-circle-zoomout' }, text: false
        }).click(function () {
            var report = ($(".activecat").find("a").attr("id"));
            if ($("#dFrom").val() == "") {
                alert("ระบุวันที่ DateFrom");
                $("#dFrom").focus();
                return;
            }
            var url
            switch (report) {
                case "a1":
                    url = '<%=Url.Action("Table_Head_Tails") %>'
                    break;
                case "a3":
                    url = '<%=Url.Action("WASTE") %>'
                    break;
                case "a4":
                    url = '<%=Url.Action("COMPOUND") %>'
                    break;
                case "a5":
                    url = '<%=Url.Action("COMPOUND_CH") %>'
                    break;
                case "a6":
                    url = '<%=Url.Action("allocate_report") %>'
                    break;
                case "a7":
                    url = '<%=Url.Action("Table_Head_Tail") %>'
                    break;
            }
            url = url  + '?prdF=' + $("#dFrom").val() + '&prdT='+$("#dTo").val();
            window.location = url;

        }); //click
        $(".inactivecat").live("click", function () {
            var link = $(this);
            $(".activecat").removeClass("activecat").addClass("inactivecat");
            link.removeClass("inactivecat").addClass("activecat");
            $("#nmRpt").text(link.text());
            var report = $.trim($(".activecat").find("a").attr("id"));
            switch (report) {
                case "a2":
                    $("#df,#dt").addClass("hide");
                    var url = '<%=Url.Action("BOMTOPCORD") %>'
                    window.location = url;
                    break;
                default:
                    $("#df,#dt").removeClass("hide");
            }

        });
    });
</script>
</asp:Content>
